from rest_framework import serializers

from student.models import Province, Municipality


class ProvinceSerializer(serializers.ModelSerializer):
    class Meta:
        model = Province
        fields = '__all__'

class MunicipalitySerializer(serializers.ModelSerializer):
    province=ProvinceSerializer(read_only=True)
    province_id=serializers.IntegerField(write_only=True)
    class Meta:
        model = Municipality
        fields = '__all__'